﻿using System;
using System.Windows;
using System.Windows.Controls;
using Infragistics.Samples.Wpf.Showcase;
using PCR;
using PCR.Base;
using PCR.Logic;
using System.Windows.Forms;

namespace Infragistics.Samples.Wpf.Showcase.Shell
{
	public partial class HomePage : Page
	{
        public HomePage()
		{
            InitializeComponent();

            this.Title = PCRRoot.Instance.ConfigManager.SoftwareName;
        }

		private void LaunchStandardCurve_Click(object sender, RoutedEventArgs e)
		{
            //NavigationService.Navigate(new Uri("MusicBrowser/MusicBrowser.xaml", UriKind.Relative));
            //NavigationService.Navigate(new Uri("StandardCurve/StandardCurve.xaml", UriKind.Relative));
            // NavigationService.Navigate(new Uri("StandardCurve/StandardCurse.xaml", UriKind.Relative));
            
        }

		private void LaunchBillboard_Click(object sender, RoutedEventArgs e)
		{
			//NavigationService.Navigate(new Uri("Billboard/Billboard.xaml", UriKind.Relative));
            // NavigationService.Navigate(new Uri("HealthCheck/HealthCheck.xaml", UriKind.Relative));

            FormSettings settingForm = new FormSettings();
            settingForm.ShowDialog();
        }

        private void LaunchUserInformation_Click(object sender, RoutedEventArgs e)
		{
            //NavigationService.Navigate(new Uri("UserInformaion/UserInformaion.xaml", UriKind.Relative));
		}

		private void LaunchTrader_Click(object sender, RoutedEventArgs e)
		{
			//NavigationService.Navigate(new Uri("Trader/xamTrader.xaml", UriKind.Relative));
		}

        private void LaunchSalesManager_Click(object sender, RoutedEventArgs e)
        {
            //NavigationService.Navigate(new Uri("SalesManager/View/MainPage.xaml", UriKind.Relative));
            DataIOManager dataIO = new DataIOManager();
            dataIO.ShowDialog();
        }

        private void speakerBtn_Click(object sender, System.Windows.RoutedEventArgs e)
        {
        	// TODO: Add event handler implementation here.
			// NavigationService.Navigate(new Uri("StandardCurve/StandardCurve.xaml", UriKind.Relative));
           //  NavigationService.Navigate(new Uri("StandardCurve/StandardCurse.xaml", UriKind.Relative));
            StandardCurveForm curveForm = new StandardCurveForm();
            curveForm.ShowDialog();
        }

        private void houseBtn_Click(object sender, System.Windows.RoutedEventArgs e)
        {
        	// TODO: Add event handler implementation here.
            // NavigationService.Navigate(new Uri("UserInformation/UserInformation.xaml", UriKind.Relative));
            //UserManagerForm userForm = new UserManagerForm();
            //userForm.ShowDialog();

            if (PCRRoot.Instance.StdCurveManager.Active == null)
            {
                System.Windows.Forms.MessageBox.Show("还未设置标准曲线！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (PCRRoot.Instance.VirusTypeManager.List == null || PCRRoot.Instance.VirusTypeManager.List.Count == 0)
            {
                System.Windows.Forms.MessageBox.Show("还未设置HPV亚型！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            UserCheckReport userReport = new UserCheckReport();
            userReport.ShowDialog();
        }
	}
}